package bootstrap

import (
	"github.com/gin-gonic/gin"
	AppRouter "go-mall/app/client/router"
	"go-mall/global"
	"net/http"
)

func CreateRouter() *gin.Engine {
	BootRouter := gin.Default()
	//prefix := "/api"
	BootRouter.StaticFS("static", http.Dir("static")) // 静态地址文件夹
	BootRouter.GET("/ping", func(c *gin.Context) {
		c.JSON(200, gin.H{
			"msg": "测试接口",
		})
	})
	//ClientAuthMiddlewarePrivateGroup := BootRouter.Group(global.CONFIG.System.RouterPrefix)
	ClientGroup := BootRouter.Group(global.CONFIG.System.RouterPrefix)
	//ClientAuthMiddlewarePrivateGroup.Use(middleware.JWTAuth())
	//AppRouter.ClientRouter(BootRouter, ClientAuthMiddlewarePrivateGroup)
	AppRouter.ClientRouter(BootRouter, ClientGroup)
	return BootRouter
}
